﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace sy3_1
{
    internal class Class1
    {
        public double x;
        public double y;
        public double r;

        // 给数据成员赋值的方法
        public void SetValue(double x, double y, double r)
        {
            this.x = x;
            this.y = y;
            this.r = r;
        }

        // 求圆的面积：πr²
        public double GetArea()
        {
            return Math.Round(Math.PI * r * r, 2);
        }

        // 求圆的周长：2πr
        public double GetPerimeter()
        {
            return Math.Round(2 * Math.PI * r, 2);
        }

        // 求圆心到原点(0,0)的距离：√(x² + y²)
        public double GetDistance()
        {
            return Math.Round(Math.Sqrt(x * x + y * y), 2);
        }
    }
}

